home *** CD-ROM | disk | FTP | other *** search
/ IRIX Patches 1995 June / SGI IRIX Patches 1995 Jun.iso / 5.3_patches / patchSG0000499 / patchSG0000499.idb / usr / include / abi / X11 / Compose.h.z / Compose.h
Encoding:
C/C++ Source or Header  |  1995-06-12  |  3.5 KB  |  108 lines

  1.  
  2. /************************************************************
  3.  Copyright (c) 1993 by Silicon Graphics Computer Systems, Inc.
  4.  
  5.  Permission to use, copy, modify, and distribute this
  6.  software and its documentation for any purpose and without
  7.  fee is hereby granted, provided that the above copyright
  8.  notice appear in all copies and that both that copyright
  9.  notice and this permission notice appear in supporting
  10.  documentation, and that the name of Silicon Graphics not be 
  11.  used in advertising or publicity pertaining to distribution 
  12.  of the software without specific prior written permission.
  13.  Silicon Graphics makes no representation about the suitability 
  14.  of this software for any purpose. It is provided "as is"
  15.  without any express or implied warranty.
  16.  
  17.  SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS 
  18.  SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 
  19.  AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
  20.  GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL 
  21.  DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, 
  22.  DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE 
  23.  OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION  WITH
  24.  THE USE OR PERFORMANCE OF THIS SOFTWARE.
  25.  
  26.  ********************************************************/
  27.  
  28. #ifndef COMPOSE_H
  29. #define    COMPOSE_H 1
  30.  
  31. typedef    CARD16    ShortKeySym;
  32. #define    COMPOSE_ShortVoidSymbol    0xffff
  33. extern    KeySym            ShortKSToKS( ShortKeySym sym,
  34.                          KeySym *private );
  35. extern    ShortKeySym        KSToShortKS( KeySym sym, KeySym *private,
  36.                                 int create );
  37.  
  38. /***====================================================================***/
  39.  
  40. typedef struct _ComposeTbl {
  41.     CARD8         type;
  42.     CARD8         keycode;
  43.     CARD16         useFlags;    /* private to Compose.c */
  44.     CARD16         kindFlags;
  45.     CARD16         szResultStr;
  46.     KeySym         introducer;
  47.     KeySym        *privateSyms;
  48.     CARD8        *resultStr;
  49.     KeySym        *ignore;
  50.     char        *name;
  51.     char        *charset;
  52.     void        *next;
  53.     void        *appPriv;    /* for use by App */
  54. } ComposeTbl;
  55.  
  56.  
  57. extern    void         ComposeInitTables(void);
  58.  
  59. extern    ComposeTbl    *ComposeReadTables(char *path);
  60. extern    ComposeTbl    *ComposeFreeTables(ComposeTbl *);
  61.  
  62. extern    ComposeTbl    *ComposeGetTables(void);
  63. extern    int         ComposeUseTables(ComposeTbl*,ComposeTbl**);
  64. extern    int         ComposeEnableTable(ComposeTbl *,int enable);
  65.  
  66. /***====================================================================***/
  67.  
  68. extern    void    *composeStateStart;
  69. extern    void    *composeStateEnd;
  70.  
  71. #define    ComposeLegalState(p) \
  72.     ((!p)||((((void*)(p))>=composeStateStart)&&\
  73.             (((void*)(p))<=composeStateEnd)))
  74. #define    ComposeLegalStatus(p) \
  75.     (((!(p)->compose_ptr)&&((p)->chars_matched==0))\
  76.      ||(((((void*)(p)->compose_ptr))>=composeStateStart)&&\
  77.             (((void*)(p)->compose_ptr)<=composeStateEnd)))
  78.  
  79. #define    COMPOSE_MAX_SYMS    30
  80. #define    COMPOSE_SYMS_SIZE    (COMPOSE_MAX_SYMS+1)
  81. #define    COMPOSE_MAX_CHARS    100
  82. #define    COMPOSE_CHARS_SIZE    (COMPOSE_MAX_CHARS+1)
  83.  
  84. #define    COMPOSE_MAX_PRIVATE    0x0fff
  85.  
  86. typedef struct _ComposeRtrn {
  87.     ComposeTbl    *tbl;
  88.     KeySym         matchSym;
  89.     KeySym         sym[COMPOSE_SYMS_SIZE];
  90.     char         str[COMPOSE_CHARS_SIZE];
  91. } ComposeRtrn;
  92.  
  93.     /*
  94.      * return values for ProcessComposeSym
  95.      */
  96. #define    COMPOSE_IGNORE    0
  97. #define    COMPOSE_IN_PROGRESS    1
  98. #define    COMPOSE_SUCCEED    2
  99. #define    COMPOSE_FAIL    3
  100.  
  101. extern    int    IsComposeKey(KeySym sym,int keycode,XComposeStatus *status);
  102. extern    int    ProcessComposeSym(XComposeStatus *status,KeySym sym,
  103.                             ComposeRtrn *rtrn);
  104. extern    void    ResetComposeStatus(XComposeStatus *status);
  105. extern    int    GetPreedit(XComposeStatus *status, ComposeRtrn *pRtrn);
  106.  
  107. #endif /* COMPOSE_H */
  108.